<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>L2LB: Referência ao ficheiro heartbeat.h</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Gerado por Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="annotated.html"><span>Estruturas&nbsp;de&nbsp;dados</span></a></li>
      <li class="current"><a href="files.html"><span>Ficheiros</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Referência ao ficheiro heartbeat.h</h1>Arquivo responsável por enviar/receber mensagens de heartbeat, para detecção de possíveis falhas em servidores. <a href="#_details">Mais...</a>
<p>

<p>
<a href="heartbeat_8h-source.html">Ir para o código fonte deste ficheiro.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Macros</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#bd1e24640abcadec19ebb45ce2f73c10">HEARTBEAT_TIMEOUT</a>&nbsp;&nbsp;&nbsp;10 * HZ</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Quantos segundos no maximo o <a class="el" href="structcluster.html" title="Cluster.">cluster</a> deve aguardar antes de remover um servidor do <a class="el" href="structcluster.html" title="Cluster.">cluster</a>, caso esse nao envie o heartbeat.  <a href="#bd1e24640abcadec19ebb45ce2f73c10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#b573f5a033c8c8920ee38447f408bbca">UDP_HEARTBEAT_PORT</a>&nbsp;&nbsp;&nbsp;1500</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Porta UDP usada no envio e recebimento dos Heartbeats.  <a href="#b573f5a033c8c8920ee38447f408bbca"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Funções</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#1cacc18d29de69dfe9b47ee4eb5e7600">hb_timer_add</a> (struct <a class="el" href="structcluster__node.html">cluster_node</a> *new_node)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepara o servidor adicionado ao <a class="el" href="structcluster.html" title="Cluster.">cluster</a> para ser removido do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> se nao receber o heartbeat.  <a href="#1cacc18d29de69dfe9b47ee4eb5e7600"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#a05383ca38bdc4afb4d20da4bfe14245">hb_timer_renew</a> (struct <a class="el" href="structcluster__node.html">cluster_node</a> *node)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Renova o timer do Heartbeat, caso seja recebido o heartbeat do servidor.  <a href="#a05383ca38bdc4afb4d20da4bfe14245"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#25dbc05b5c8157863bcb1801c17f77c1">hb_broadcast_msg</a> (char *buf, int buf_len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Envia uma mensagem em Brodcast para todos os nós do <a class="el" href="structcluster.html" title="Cluster.">cluster</a>.  <a href="#25dbc05b5c8157863bcb1801c17f77c1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#8c2bcf74f2baf343f7ee6f8cf8d26aaf">hb_rebuild_msg</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Re-cria a mensagem de envio do heartbeat.  <a href="#8c2bcf74f2baf343f7ee6f8cf8d26aaf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#c6c61bdfb86af95a46983e4ac5ded3e5">nlb_load_heartbeat_signal</a> (char *msg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Carrega uma mensagem de heartbear.  <a href="#c6c61bdfb86af95a46983e4ac5ded3e5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#d969b6fda1c74c864aaa7587b1d46be4">hb_udb_server_start</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Inicia o servidor UDP que irá RECEBER as mensagens de Heartbeat dos servidores do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> e notificar ao <a class="el" href="structcluster.html" title="Cluster.">cluster</a> o status dessas mensagens.  <a href="#d969b6fda1c74c864aaa7587b1d46be4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#795b268047cc6c36f223e0fdcc5d4583">hb_udb_client_start</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Iniciar o cliente UDP que irá ENVIAR as mensagens de heartbeat deste servidor do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> (<a class="el" href="cluster_8h.html#39e3ce09327c335c6a58f152f9d8fbbf" title="Nó do cluster.">my_cluster.my_node</a>) A mensagem é enviada em Broadcast para o <a class="el" href="structcluster.html" title="Cluster.">cluster</a>.  <a href="#795b268047cc6c36f223e0fdcc5d4583"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a> **&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#95053b46f210b2f1451e3314bd4e4221">hb_get_udp_server_thread</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">static struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a> **&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#61f03f1313c2bf412a60f54162b287da">hb_get_udp_client_thread</a> (void)</td></tr>

<tr><td colspan="2"><br><h2>Variáveis</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#b5e2712d83aef730daa0f547e6218e9f">hb_msg_buff</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mensagem enviada no Heartbeat.  <a href="#b5e2712d83aef730daa0f547e6218e9f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">volatile int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#adfc50704f2f70e43acd9d50b70f9a24">hb_msg_buff_len</a> = 0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#63e6914e51b6e79ae83f8c548c7a9e70">broadcast</a> = 1</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Envia a mensagem em Broadcast?  <a href="#63e6914e51b6e79ae83f8c548c7a9e70"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#9a09c37d118a488eb9427f761be51f08">hb_udp_server_thread</a> = NULL</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Thread para o socket do servidor UDP.  <a href="#9a09c37d118a488eb9427f761be51f08"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="heartbeat_8h.html#47b8a08bfc4c35b86ff52bce2783d51a">hb_udp_client_thread</a> = NULL</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Thread para o sockete do cliente UDP.  <a href="#47b8a08bfc4c35b86ff52bce2783d51a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Descrição detalhada</h2>
Arquivo responsável por enviar/receber mensagens de heartbeat, para detecção de possíveis falhas em servidores. 
<p>
Um heartbeat é um sinal enviado por um servidor aos demais servidores para notificar que ele está operacional. 
<p>Definido no ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>
<hr><h2>Documentação das macros</h2>
<a class="anchor" name="bd1e24640abcadec19ebb45ce2f73c10"></a><!-- doxytag: member="heartbeat.h::HEARTBEAT_TIMEOUT" ref="bd1e24640abcadec19ebb45ce2f73c10" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HEARTBEAT_TIMEOUT&nbsp;&nbsp;&nbsp;10 * HZ          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Quantos segundos no maximo o <a class="el" href="structcluster.html" title="Cluster.">cluster</a> deve aguardar antes de remover um servidor do <a class="el" href="structcluster.html" title="Cluster.">cluster</a>, caso esse nao envie o heartbeat. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00015">15</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00038">hb_timer_add()</a> e <a class="el" href="heartbeat_8h-source.html#l00058">hb_timer_renew()</a>.</p>

</div>
</div><p>
<a class="anchor" name="b573f5a033c8c8920ee38447f408bbca"></a><!-- doxytag: member="heartbeat.h::UDP_HEARTBEAT_PORT" ref="b573f5a033c8c8920ee38447f408bbca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UDP_HEARTBEAT_PORT&nbsp;&nbsp;&nbsp;1500          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Porta UDP usada no envio e recebimento dos Heartbeats. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00020">20</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a> e <a class="el" href="heartbeat_8h-source.html#l00168">hb_udb_server_start()</a>.</p>

</div>
</div><p>
<hr><h2>Documentação das funções</h2>
<a class="anchor" name="25dbc05b5c8157863bcb1801c17f77c1"></a><!-- doxytag: member="heartbeat.h::hb_broadcast_msg" ref="25dbc05b5c8157863bcb1801c17f77c1" args="(char *buf, int buf_len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hb_broadcast_msg           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>buf_len</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Envia uma mensagem em Brodcast para todos os nós do <a class="el" href="structcluster.html" title="Cluster.">cluster</a>. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>Buffer da mensagem </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buf_len</em>&nbsp;</td><td>Tamanho do buffer da mensagem </td></tr>
  </table>
</dl>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00079">79</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="socket_8h-source.html#l00038">ksock_thread_t::addr_send</a>, <a class="el" href="socket_8h-source.html#l00049">ksocket_send()</a> e <a class="el" href="socket_8h-source.html#l00031">ksock_thread_t::sock</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a> e <a class="el" href="cluster_8h-source.html#l00125">remove_cluster_node()</a>.</p>

</div>
</div><p>
<a class="anchor" name="61f03f1313c2bf412a60f54162b287da"></a><!-- doxytag: member="heartbeat.h::hb_get_udp_client_thread" ref="61f03f1313c2bf412a60f54162b287da" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a>** hb_get_udp_client_thread           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static, read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00326">326</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="structksock__thread__t.html#2fd9f49a71f307cb4f2c1ca3940af8cb">ksock_thread_t::fn</a> e <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a>.</p>

<p>Referenciado por <a class="el" href="thread_8h-source.html#l00016">nlb_thread_init()</a>.</p>

</div>
</div><p>
<a class="anchor" name="95053b46f210b2f1451e3314bd4e4221"></a><!-- doxytag: member="heartbeat.h::hb_get_udp_server_thread" ref="95053b46f210b2f1451e3314bd4e4221" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a>** hb_get_udp_server_thread           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static, read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00316">316</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="structksock__thread__t.html#2fd9f49a71f307cb4f2c1ca3940af8cb">ksock_thread_t::fn</a> e <a class="el" href="heartbeat_8h-source.html#l00168">hb_udb_server_start()</a>.</p>

<p>Referenciado por <a class="el" href="thread_8h-source.html#l00016">nlb_thread_init()</a>.</p>

</div>
</div><p>
<a class="anchor" name="8c2bcf74f2baf343f7ee6f8cf8d26aaf"></a><!-- doxytag: member="heartbeat.h::hb_rebuild_msg" ref="8c2bcf74f2baf343f7ee6f8cf8d26aaf" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void hb_rebuild_msg           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Re-cria a mensagem de envio do heartbeat. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00094">94</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="heartbeat_8h-source.html#l00025">hb_msg_buff</a>, <a class="el" href="heartbeat_8h-source.html#l00026">hb_msg_buff_len</a>, <a class="el" href="cluster_8h-source.html#l00017">cluster_node::id</a>, <a class="el" href="cluster_8h.html#1917b2709741dea7ce5cf6ea441686ed">my_cluster</a>, <a class="el" href="cluster_8h-source.html#l00040">cluster::my_node</a>, <a class="el" href="cluster_8h-source.html#l00041">cluster::next_serving</a> e <a class="el" href="cluster_8h-source.html#l00042">cluster::node_count</a>.</p>

<p>Referenciado por <a class="el" href="interface_8h-source.html#l00053">cmd_my_node()</a>.</p>

</div>
</div><p>
<a class="anchor" name="1cacc18d29de69dfe9b47ee4eb5e7600"></a><!-- doxytag: member="heartbeat.h::hb_timer_add" ref="1cacc18d29de69dfe9b47ee4eb5e7600" args="(struct cluster_node *new_node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hb_timer_add           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcluster__node.html">cluster_node</a> *&nbsp;</td>
          <td class="paramname"> <em>new_node</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Prepara o servidor adicionado ao <a class="el" href="structcluster.html" title="Cluster.">cluster</a> para ser removido do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> se nao receber o heartbeat. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>new_node</em>&nbsp;</td><td>Servidor </td></tr>
  </table>
</dl>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00038">38</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="cluster_8h-source.html#l00021">cluster_node::hb_timer</a>, <a class="el" href="heartbeat_8h-source.html#l00015">HEARTBEAT_TIMEOUT</a> e <a class="el" href="cluster_8h-source.html#l00125">remove_cluster_node()</a>.</p>

<p>Referenciado por <a class="el" href="cluster_8h-source.html#l00077">add_cluster_node()</a>.</p>

</div>
</div><p>
<a class="anchor" name="a05383ca38bdc4afb4d20da4bfe14245"></a><!-- doxytag: member="heartbeat.h::hb_timer_renew" ref="a05383ca38bdc4afb4d20da4bfe14245" args="(struct cluster_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hb_timer_renew           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcluster__node.html">cluster_node</a> *&nbsp;</td>
          <td class="paramname"> <em>node</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Renova o timer do Heartbeat, caso seja recebido o heartbeat do servidor. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>Servidor </td></tr>
  </table>
</dl>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00058">58</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="cluster_8h-source.html#l00021">cluster_node::hb_timer</a> e <a class="el" href="heartbeat_8h-source.html#l00015">HEARTBEAT_TIMEOUT</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00121">nlb_load_heartbeat_signal()</a>.</p>

</div>
</div><p>
<a class="anchor" name="795b268047cc6c36f223e0fdcc5d4583"></a><!-- doxytag: member="heartbeat.h::hb_udb_client_start" ref="795b268047cc6c36f223e0fdcc5d4583" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void hb_udb_client_start           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Iniciar o cliente UDP que irá ENVIAR as mensagens de heartbeat deste servidor do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> (<a class="el" href="cluster_8h.html#39e3ce09327c335c6a58f152f9d8fbbf" title="Nó do cluster.">my_cluster.my_node</a>) A mensagem é enviada em Broadcast para o <a class="el" href="structcluster.html" title="Cluster.">cluster</a>. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00240">240</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="socket_8h-source.html#l00032">ksock_thread_t::addr</a>, <a class="el" href="socket_8h-source.html#l00038">ksock_thread_t::addr_send</a>, <a class="el" href="heartbeat_8h-source.html#l00031">broadcast</a>, <a class="el" href="heartbeat_8h-source.html#l00079">hb_broadcast_msg()</a>, <a class="el" href="heartbeat_8h-source.html#l00025">hb_msg_buff</a>, <a class="el" href="heartbeat_8h-source.html#l00026">hb_msg_buff_len</a>, <a class="el" href="socket_8h-source.html#l00009">INADDR_SEND</a>, <a class="el" href="socket_8h-source.html#l00026">ksock_thread_t::running</a>, <a class="el" href="socket_8h-source.html#l00031">ksock_thread_t::sock</a>, <a class="el" href="socket_8h-source.html#l00019">ksock_thread_t::thread</a> e <a class="el" href="heartbeat_8h-source.html#l00020">UDP_HEARTBEAT_PORT</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00326">hb_get_udp_client_thread()</a>.</p>

</div>
</div><p>
<a class="anchor" name="d969b6fda1c74c864aaa7587b1d46be4"></a><!-- doxytag: member="heartbeat.h::hb_udb_server_start" ref="d969b6fda1c74c864aaa7587b1d46be4" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void hb_udb_server_start           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Inicia o servidor UDP que irá RECEBER as mensagens de Heartbeat dos servidores do <a class="el" href="structcluster.html" title="Cluster.">cluster</a> e notificar ao <a class="el" href="structcluster.html" title="Cluster.">cluster</a> o status dessas mensagens. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00168">168</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="socket_8h-source.html#l00032">ksock_thread_t::addr</a>, <a class="el" href="heartbeat_8h-source.html#l00031">broadcast</a>, <a class="el" href="socket_8h-source.html#l00087">ksocket_receive()</a>, <a class="el" href="heartbeat_8h-source.html#l00121">nlb_load_heartbeat_signal()</a>, <a class="el" href="socket_8h-source.html#l00026">ksock_thread_t::running</a>, <a class="el" href="socket_8h-source.html#l00031">ksock_thread_t::sock</a>, <a class="el" href="socket_8h-source.html#l00019">ksock_thread_t::thread</a> e <a class="el" href="heartbeat_8h-source.html#l00020">UDP_HEARTBEAT_PORT</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00316">hb_get_udp_server_thread()</a>.</p>

</div>
</div><p>
<a class="anchor" name="c6c61bdfb86af95a46983e4ac5ded3e5"></a><!-- doxytag: member="heartbeat.h::nlb_load_heartbeat_signal" ref="c6c61bdfb86af95a46983e4ac5ded3e5" args="(char *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void nlb_load_heartbeat_signal           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>msg</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Carrega uma mensagem de heartbear. 
<p>
<dl compact><dt><b>Parâmetros:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td>Mensagem </td></tr>
  </table>
</dl>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00121">121</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referências <a class="el" href="cluster_8h-source.html#l00180">get_node_by_id()</a>, <a class="el" href="heartbeat_8h-source.html#l00058">hb_timer_renew()</a> e <a class="el" href="cluster_8h-source.html#l00125">remove_cluster_node()</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00168">hb_udb_server_start()</a>.</p>

</div>
</div><p>
<hr><h2>Documentação das variáveis</h2>
<a class="anchor" name="63e6914e51b6e79ae83f8c548c7a9e70"></a><!-- doxytag: member="heartbeat.h::broadcast" ref="63e6914e51b6e79ae83f8c548c7a9e70" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="heartbeat_8h.html#63e6914e51b6e79ae83f8c548c7a9e70">broadcast</a> = 1<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Envia a mensagem em Broadcast? 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00031">31</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a> e <a class="el" href="heartbeat_8h-source.html#l00168">hb_udb_server_start()</a>.</p>

</div>
</div><p>
<a class="anchor" name="b5e2712d83aef730daa0f547e6218e9f"></a><!-- doxytag: member="heartbeat.h::hb_msg_buff" ref="b5e2712d83aef730daa0f547e6218e9f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="heartbeat_8h.html#b5e2712d83aef730daa0f547e6218e9f">hb_msg_buff</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mensagem enviada no Heartbeat. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00025">25</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00094">hb_rebuild_msg()</a> e <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a>.</p>

</div>
</div><p>
<a class="anchor" name="adfc50704f2f70e43acd9d50b70f9a24"></a><!-- doxytag: member="heartbeat.h::hb_msg_buff_len" ref="adfc50704f2f70e43acd9d50b70f9a24" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile int <a class="el" href="heartbeat_8h.html#adfc50704f2f70e43acd9d50b70f9a24">hb_msg_buff_len</a> = 0          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00026">26</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="heartbeat_8h-source.html#l00094">hb_rebuild_msg()</a> e <a class="el" href="heartbeat_8h-source.html#l00240">hb_udb_client_start()</a>.</p>

</div>
</div><p>
<a class="anchor" name="47b8a08bfc4c35b86ff52bce2783d51a"></a><!-- doxytag: member="heartbeat.h::hb_udp_client_thread" ref="47b8a08bfc4c35b86ff52bce2783d51a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a>* <a class="el" href="heartbeat_8h.html#47b8a08bfc4c35b86ff52bce2783d51a">hb_udp_client_thread</a> = NULL          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Thread para o sockete do cliente UDP. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00071">71</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="9a09c37d118a488eb9427f761be51f08"></a><!-- doxytag: member="heartbeat.h::hb_udp_server_thread" ref="9a09c37d118a488eb9427f761be51f08" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structksock__thread__t.html">ksock_thread_t</a>* <a class="el" href="heartbeat_8h.html#9a09c37d118a488eb9427f761be51f08">hb_udp_server_thread</a> = NULL          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Thread para o socket do servidor UDP. 
<p>

<p>Definido na linha <a class="el" href="heartbeat_8h-source.html#l00066">66</a> do ficheiro <a class="el" href="heartbeat_8h-source.html">heartbeat.h</a>.</p>

<p>Referenciado por <a class="el" href="thread_8h-source.html#l00045">nlb_thread_exit()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Gerado em Wed Sep 10 23:05:55 2008 para L2LB por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
